<!--
 * @Description: 班级信息管理
 * @Author: liyujie
 * @Date: 2021/07/27
 * @Last Modified by: liyujie
 * @Last Modified time: 2021/07/27
-->
<template>
    <section class="wrapper">
        <div class="content-wrapper">
            <!-- header -->
            <div class="header">
                <div class="header-title">
                    班级信息管理
                </div>
            </div>
            <!-- /header -->
            <div class="statistics-wrapper">
                <div class="statistics-header">
                    <div class="left">
                        <div class="statistics-title">新增班级数量</div>
                        <el-button
                            type="text"
                            class="opt-btn"
                            @click="fnGetTotalCount"
                        >
                            查看新增班级统计数量
                            <i :class="show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"/>
                        </el-button>
                    </div>
                    <el-button
                        type="primary"
                        size="medium"
                        style="width: 128px"
                        @click="handleRoute('socialClassAdd', {type: 1})"
                    >
                        新增班级
                    </el-button>
                </div>
                <div
                    class="stat"
                    v-if="show"
                >
                    <div
                        class="stat-item"
                        v-for="(item, index) in classTotalCount"
                        :key="index"
                    >
                        <p class="title">新增:{{ item.new_enable_count }}</p>
                        <p class="num">{{ item.day_time * 1000 | dateFormatter('yyyy/MM/dd') }}</p>
                    </div>
                </div>
            </div>
            <div style="height: 12px;background: #F0F2F5"/>
            <!-- 筛选-->
            <div class="filter-view">
                <div class="header-new-box">
                    <p class="header-new-box-title">
                        选择学校
                    </p>
                    <el-cascader
                        v-model="cityCollege"
                        :options="school_tree"
                        @change="getTableData(1)"
                        size="medium"
                        clearable
                        filterable
                        style="width: 292px;"
                        :props="{
                            checkStrictly: true,
                            value: 'id',
                            label: 'name',
                            children: 'children',
                            lazy: true,
                            leaf: 'leaf',
                            lazyLoad: getCollegeList
                        }"
                    />
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">
                        入学年份
                    </p>
                    <el-select
                        v-model="filterData.enter_school_start_year"
                        placeholder="开始年份"
                        size="medium"
                        clearable
                        style="width: 152px;"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in yearList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                    <span style="margin: 0 12px">-</span>
                    <el-select
                        v-model="filterData.enter_school_end_year"
                        placeholder="结束年份"
                        size="medium"
                        clearable
                        style="width: 152px;"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in yearList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                            :disabled="item.value < filterData.enter_school_start_year"
                        />
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">
                        班级状态
                    </p>
                    <el-select
                        v-model="filterData.status"
                        placeholder="请选择"
                        size="medium"
                        clearable
                        style="width: 152px;"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in statusList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"/>
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">
                        来源
                    </p>
                    <el-select
                        v-model="filterData.from_type"
                        placeholder="请选择"
                        size="medium"
                        style="width: 152px;"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in sourceList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"/>
                    </el-select>
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">
                        其他
                    </p>
                    <el-input
                        v-model="filterData.keyword"
                        placeholder="请输入班级名称或用户姓名或手机号"
                        suffix-icon="el-icon-search"
                        size="medium"
                        clearable
                        class="search-ipt"
                        style="width: 282px"
                        @change="getTableData(1)"
                        @keyup.native.enter="getTableData(1)"
                    />
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">
                        提交时间
                    </p>
                    <el-date-picker
                        v-model="dateTimeRange"
                        type="datetimerange"
                        range-separator="-"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                        :default-time="['00:00:00', '23:59:59']"
                        size="medium"
                        style="width: 360px"
                        value-format="timestamp"
                    />
                </div>

                <div class="header-new-box">
                    <el-button
                        type="primary"
                        size="small"
                        class="query-button"
                        @click="getTableData(1)"
                    >
                        查询
                    </el-button>
                    <el-button
                        type="text"
                        @click="handleReset()"
                    >
                        重置
                    </el-button>
                </div>
            </div>
            <!--筛选-->
            <!-- table -->
            <div class="table-wrapper">
                <el-table
                    :data="tableData"
                    height="100%"
                    style="width: 100%;"
                    ref="table"
                    class="data-table"
                    :cell-style="{height: '40px'}"
                    v-loading="tableLoading"
                    @sort-change="handleSortChange"
                >
                    <el-table-column
                        label="序号"
                        type="index"
                        align="center"
                        width="80"
                    />
                    <el-table-column
                        prop="school_name"
                        label="学校名称"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                    />
                    <el-table-column
                        prop="college_name"
                        label="学院名称"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                    />
                    <el-table-column
                        prop="major_name"
                        label="专业名称"
                        align="center"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                    />
                    <el-table-column
                        prop="education_year"
                        label="学制"
                        align="center"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                    />
                    <el-table-column
                        prop="enter_school_year"
                        label="入学年份"
                        align="center"
                        :formatter="emptyFormatter"
                    />
                    <el-table-column
                        prop="class_name"
                        label="班级名称"
                        align="center"
                        :formatter="emptyFormatter"
                    >
                        <template slot-scope="scope">
                            <el-button
                                type="text"
                                @click="handleRoute('socialClassDetail', {class_no: scope.row.class_no, from_type: 'socialClassList'})"
                            >
                                {{ scope.row.class_name }}
                            </el-button>
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="class_group_number"
                        label="班级QQ群号"
                        align="center"
                        :formatter="emptyFormatter"
                    />
                    <el-table-column
                        prop="student_count"
                        label="班级加入人数"
                        align="center"
                        width="130"
                        sortable="custom"
                    />
                    <el-table-column
                        label="来源"
                        align="center"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                    >
                        <template slot-scope="scope">
                            <div v-if="scope.row.from_type === 0">平台创建</div>
                            <div v-else-if="scope.row.from_type === 1">用户创建</div>
                            <div v-else-if="scope.row.from_type === 2">任务创建</div>
                            <div v-else>--</div>
                        </template>
                    </el-table-column>
                    <el-table-column
                        label="创建时间"
                        width="160"
                        :formatter="emptyFormatter"
                    >
                        <template slot-scope="scope">
                            {{ scope.row.create_time * 1000 | dateFormatter('yyyy/MM/dd HH:mm:ss') }}
                        </template>
                    </el-table-column>
                    <el-table-column
                        label="创建人"
                        align="center"
                        width="140"
                        :formatter="emptyFormatter"
                    >
                        <template slot-scope="scope">
                            <template v-if="scope.row.from_type === 0">
                                <div>{{ scope.row.from_admin_true_name }}</div>
                            </template>
                            <template v-else-if="scope.row.from_type === 1 || scope.row.from_type === 2">
                                <div>{{ scope.row.from_user_name }}</div>
                                <div>{{ scope.row.from_user_no }}</div>
                            </template>
                            <template v-else>--</template>
                        </template>
                    </el-table-column>
                    <el-table-column
                        label="操作"
                        align="left"
                        fixed="right"
                        width="180"
                    >
                        <template slot-scope="scope">
                            <div class="option-btn-group">
                                <el-button
                                    type="text"
                                    :disabled="scope.row.class_status === 0"
                                    @click="fnEditInfo(scope.row)"
                                >
                                    修改资料
                                </el-button>
                                <el-button
                                    type="text"
                                    :disabled="scope.row.class_status === 0"
                                    @click="fnSetClassStatus(scope.row)"
                                >
                                    {{ scope.row.class_status === 1 ? '解散班级' : '已解散' }}
                                </el-button>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <!-- /table -->
            <!-- /分页 -->
            <div class="pagination-wrapper clearfix">
                <el-pagination
                    layout="total, prev, pager, next, jumper"
                    background
                    :current-page.sync="page.now_page"
                    :total="page.total_count"
                    :page-size="page.page_size"
                    @current-change="getTableData"
                />
            </div>
        </div>
        <!-- 修改资料弹窗 -->
        <el-dialog
            title="修改资料"
            width="680px"
            :visible.sync="showChangeClassFlag"
            :close-on-click-modal="false"
        >
            <el-form
                :model="ruleFormClass"
                :rules="rulesClass"
                ref="ruleFormClass"
                label-width="140px"
                class="demo-ruleForm"
            >
                <el-form-item
                    label="专业名称"
                    prop="major_name"
                >
                    <el-input
                        v-model="ruleFormClass.major_name"
                        size="medium"
                        clearable
                        style="width: 400px"
                        disabled
                    />
                </el-form-item>
                <el-form-item
                    label="学制"
                    prop="education_year"
                >
                    <el-select
                        v-model="ruleFormClass.education_year"
                        placeholder="请选择"
                        size="medium"
                        style="width: 400px"
                        disabled
                    >
                        <el-option
                            v-for="item in 4"
                            :key="item"
                            :label="item + 1"
                            :value="item + 1"
                        />
                    </el-select>
                </el-form-item>
                <el-form-item
                    label="选择班级"
                    prop="class_index"
                >
                    <el-select
                        v-model="ruleFormClass.class_index"
                        placeholder="请选择"
                        size="medium"
                        style="width: 400px"
                    >
                        <el-option
                            v-for="item in 10"
                            :key="item"
                            :label="item < 10 ? `0${item}` : item"
                            :value="item"
                        />
                    </el-select>
                </el-form-item>
                <el-form-item
                    label="入学年份"
                    prop="enter_school_year"
                >
                    <el-select
                        v-model="ruleFormClass.enter_school_year"
                        placeholder="请选择"
                        size="medium"
                        clearable
                        style="width: 400px"
                    >
                        <el-option
                            v-for="item in yearList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                </el-form-item>
                <el-form-item
                    label="班级QQ群号"
                    prop="class_group_number"
                >
                    <el-input
                        v-model="ruleFormClass.class_group_number"
                        size="medium"
                        clearable
                        style="width: 400px"
                    />
                </el-form-item>
            </el-form>

            <div
                slot="footer"
                class="dialog-footer"
            >
                <el-button
                    size="medium"
                    style="width: 120px"
                    @click="showChangeClassFlag = false"
                >
                    取 消
                </el-button>
                <el-button
                    type="primary"
                    size="medium"
                    style="width: 120px;margin-left: 32px"
                    @click="fnConfirmClass('ruleFormClass')"
                >
                    确定
                </el-button>
            </div>
        </el-dialog>
        <!-- /修改资料弹窗 -->
    </section>
</template>

<script>
import { back } from '@/mixin/back';

export default {
    name: 'SocialClassList',
    mixins: [back],
    components: {},
    data() {
        return {
            class_no: '',
            show: false,
            // 统计数据列表
            classTotalCount: [],
            // 筛选条件
            filterData: {
                // 学校ID
                city_id: '',
                // 学校ID
                school_id: '',
                // 学院编号
                college_no: '',
                // 状态,-1:未激活,1:已激活
                status: '',
                // 关键词
                keyword: '',
                // 来源,99:全部,0:平台导入,1:学生创建
                from_type: 99,
                // 排序字段名,0:默认排序,1:班级入住人数
                sort_field: '',
                // 排序方式,0:正序,1:倒序
                sort_type: '',
                // 开始时间
                start_time: '',
                // 结束时间
                end_time: '',
                // 入学年份
                enter_school_year: '',
                enter_school_start_year: '',
                enter_school_end_year: '',
            },
            tableData: [],
            tableLoading: false,
            page: {
                now_page: 1,
                total_count: 0,
                page_size: 20
            },
            dateTimeRange: [],
            // 选择的学校列表
            cityCollege: [],
            // 学校三级联动数据
            school_tree: [],
            // 入学年份
            yearList: [],
            // 状态数据
            statusList: [
                { value: '', label: '全部' },
                { value: 1, label: '启用中' },
                { value: -1, label: '已解散' }
            ],
            // 来源数据
            sourceList: [
                { value: 99, label: '全部' },
                { value: 0, label: '平台创建' },
                { value: 1, label: '用户创建' },
                { value: 2, label: '任务创建' },
            ],
            showChangeClassFlag: false,
            ruleFormClass: {
                class_no: '',
                major_name: '',
                education_year: 0,
                enter_school_year: '',
                class_index: 0,
                class_group_number: '',
            },
            rulesClass: {
                enter_school_year: [
                    { required: true, message: '请填写班级人数', trigger: 'blur' }
                ]
            },
            authResult: {}
        };
    },
    computed: {},
    filters: {},
    watch: {
        dateTimeRange(value) {
            this.filterData.start_time = value ? value[0] / 1000 : '';
            this.filterData.end_time = value ? value[1] / 1000 : '';
            this.getTableData(1);
        }
    },
    mounted() {
        this.$store.commit('SET_HEADER', [{title: "APP后台"}, {title: '社交'}, {title: '班级信息管理'}]);
        this.authResult = this.$route.meta.authResult;
        const query = this.$route.query;

        if (query.name !== 'undefined' || query.name !== undefined) {
            this.filterData.keyword = query.name;
            this.cityCollege.push(
                '',
                query.school_id,
                query.college_no
            );
        }
        this.getTableData();
        this.getSchoolTree();
        this.getYearList(2015);
    },

    methods: {

        /**
         * 获取三级联动数据
         */
        getSchoolTree () {
            this.$post('/student/local_info%5Cschool_tree',{},resp => {
                if (resp.code === 1) {
                    this.school_tree = resp.data.tree;
                }
            });
        },

        /**
         * 获取入学年份
         */
        getYearList (yearList) {
            let year = new Date().getFullYear();
            let newYear = [];

            for(let i = year; i >= yearList; i--) {
                newYear.push({
                    value: i,
                    label: i
                });
            }
            this.yearList = this.yearList.concat(newYear);
        },

        /**
         * @description 获取列表数据
         * @param page
         */
        getTableData(page) {
            this.tableLoading = true;
            let params = { ...this.filterData };

            params.page_id = page || this.page.now_page;
            params.city_id = this.cityCollege !== '' ? this.cityCollege[1] : this.cityCollege;
            params.school_id = this.cityCollege !== '' ? this.cityCollege[2] : this.cityCollege;
            params.college_no = this.cityCollege !== '' ? this.cityCollege[3] : this.cityCollege;
            this.$post('/student/region_class%5Cget_list', params, res => {
                if (res.code === 1) {
                    this.tableData = res.data.list;
                    this.page = res.data.page;
                } else {
                    this.$notify({
                        title: '提示',
                        message: res.msg,
                        type: 'warning'
                    });
                }
                this.tableLoading = false;
            });
        },

        /**
         * 路由跳转
         * @param routeName
         * @param query
         */
        handleRoute(routeName, query) {
            this.$router.push({
                name: routeName,
                query
            });
        },

        /**
         * @description 过滤函数
         */
        emptyFormatter(row, column, val) {
            if (!val) return '--';
            return val;
        },

        /**
         * 重置筛选条件
         */
        handleReset() {
            this.filterData = {
                city_id: '',
                school_id: '',
                college_no: '',
                enter_school_year: '',
                status: '',
                // 关键词
                keyword: '',
                from_type: 99,
                sort_field: '',
                sort_type: '',
                start_time: '',
                end_time: '',
                enter_school_start_year: '',
                enter_school_end_year: '',
            };
            this.cityCollege = [];
            this.dateTimeRange = null;
            this.$refs.table.clearSort();
            this.getTableData(1);
        },

        /**
         * 获取统计数据
         */
        fnGetTotalCount() {
            this.show = !this.show;
            if(this.classTotalCount.length > 0) {
                return;
            }
            this.$post('/task/statistic%5Cclass_enable', {}, resp => {
                if (resp.code === 1) {
                    this.classTotalCount = resp.data;
                }
            });
        },

        /**
         * 获取学院
         * @param node
         * @param resolve
         */
        getCollegeList(node, resolve) {
            const { level, data, value } = node;

            if(level < 3) {
                resolve(data);
            } else {
                this.$post('/student/region_college%5Cget_list_for_select', {
                    school_id: value
                }, resp => {
                    if (resp.code === 1) {
                        let result = resp.data.list.map((item) => {
                            return {
                                id: item.college_no,
                                name: item.college_name,
                                leaf: true
                            };
                        });

                        resolve(result);
                    } else{
                        this.$notify({
                            title: '提示',
                            type: 'warning',
                            message: resp.msg
                        });
                    }
                });
            }
        },

        /**
         * 修改资料
         */
        fnEditInfo (row) {
            this.$post('/student/region_class%5Cget', {
                class_no: row.class_no
            }, resp => {
                if (resp.code === 1) {
                    this.showChangeClassFlag = !this.showChangeClassFlag;
                    this.ruleFormClass = {
                        ...resp.data,
                        major_name: row.major_name,
                        class_index: row.class_index
                    };
                } else {
                    this.$notify({
                        title: '提示',
                        type: 'warning',
                        message: resp.msg
                    });
                }
            });

        },

        /**
         * 启用/禁用班级
         */
        fnSetClassStatus (row) {
            if (row.class_status === 1 && row.join_student_num > 0) {
                this.$notify({
                    title: '提示',
                    type: 'warning',
                    message: '班级人数不为0，不可禁用'
                });
                return;
            }

            let status = row.class_status === 1 ? 0 : 1;

            this.$post('/student/region_class%5Cset_status', {
                class_no: row.class_no,
                class_status: status
            }, resp => {
                if (resp.code === 1) {
                    this.$set(row,'class_status', status);
                    this.$notify({
                        title: '提示',
                        type: 'success',
                        message: '修改成功'
                    });
                } else {
                    this.$notify({
                        title: '提示',
                        type: 'warning',
                        message: resp.msg
                    });
                }
            });
        },

        /**
         * 确定修改资料
         */
        fnConfirmClass (formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.$post('/student/region_class%5Csave', {
                        ...this.ruleFormClass
                    },resp => {
                        this.showChangeClassFlag = !this.showChangeClassFlag;
                        if (resp.code === 1) {
                            this.getTableData(1);
                            this.$notify({
                                title: '提示',
                                type: 'success',
                                message: '修改成功'
                            });
                        } else {
                            this.$notify({
                                title: '提示',
                                type: 'warning',
                                message: resp.msg
                            });
                        }
                    });
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },

        /**
         * 处理排序
         * @param data
         */
        handleSortChange(data) {
            console.log(data);
            let sortFieldMap = {
                student_count: 1,
            };

            let sortTypeMap = {
                ascending: 0,
                descending: 1
            };

            if (data.order) {
                this.filterData.sort_field =sortFieldMap[data.prop];
                this.filterData.sort_type = sortTypeMap[data.order];
            } else {
                this.filterData.sort_field = '';
                this.filterData.sort_type = '';
            }

            this.getTableData();
        },
    }
};
</script>

<style lang="less" scoped>
.wrapper {
    width: 100%;

    .content-wrapper {
        display: flex;
        height: calc(100% - 24px);
        flex-direction: column;
        position: relative;
        margin: 12px;
        background: #fff;
        box-sizing: border-box;

        /*header*/

        .header {
            height: 68px;
            padding: 24px;
            box-sizing: border-box;
            box-shadow: 0px -1px 0px 0px #F0F2F5;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #F0F2F5;

            .header-title {
                color: #333333;
                font-size: 20px;
                height: 20px;
                font-weight: 500;
                position: relative;
                margin: 24px 0 24px 12px;

                &::before {
                    content: '';
                    position: absolute;
                    left: -8px;
                    top: -1px;
                    width: 3px;
                    height: 20px;
                    background: #1890FF;
                }
            }
        }
        .statistics-wrapper {
            padding: 0 32px;
            .statistics-header {
                height: 84px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                .left {
                    display: flex;
                    align-items: center;
                    .statistics-title {
                        font-size: 16px;
                        font-family: PingFangSC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                        height: 36px;
                        line-height: 36px;
                        padding-right: 16px;
                        border-right: 1px solid #EBEEF5;
                        margin-right: 16px;
                    }
                    .opt-btn {
                        font-size: 14px;
                        font-family: PingFangSC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #20A0FF;
                    }
                }
            }
        }

        /*筛选*/

        .filter-view {
            box-sizing: border-box;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            padding: 0 24px;
            margin-top: 24px;

            .header-new-box {
                display: flex;
                align-items: center;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #333333;
                white-space: nowrap;
                margin-right: 24px;
                margin-bottom: 12px;

                &-title {
                    margin-right: 16px;
                    white-space: nowrap;
                }
                .query-button  {
                    width: 84px;
                    height: 36px;
                    background: #FFFFFF;
                    border-radius: 4px;
                    border: 1px solid #1890FF;
                    font-size: 14px;
                    font-family: PingFangSC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #1890FF;
                    margin-right: 12px;
                }
            }
        }

        // 表格
        .table-wrapper {
            padding: 0 24px;
            flex: 1;
            height: 0;
            .cell-title {
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #333333;
                margin-bottom: 12px;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                overflow: hidden;
                -webkit-line-clamp: 2;
            }
            .cell-content {
                display: -webkit-box;
                -webkit-box-orient: vertical;
                overflow: hidden;
                -webkit-line-clamp: 3;
            }
            .cell-tips {
                color: #999;
            }
        }
        .data-table {
            ::-webkit-scrollbar {
                width: 6px;
                height: 6px;
            }
            // 操作按钮
            .option-btn-group {
                .el-button {
                    margin-left: 0;
                    margin-right: 10px;
                }
            }
        }
        .status-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;

            .status-dot {
                width: 6px;
                height: 6px;
                border-radius: 50%;
                margin-right: 5px;

                &.success {
                    background: #4CD964;
                }

                &.danger {
                    background: #FF3030;
                }

                &.warning {
                    background: #FFA72D;
                }

                &.normal {
                    background: #A6A6A6;
                }
            }
        }

        /* 分页 */
        .pagination-wrapper {
            padding: 12px 24px;
            .el-pagination {
                float: right;
                padding: 0;
                background-color: transparent;
            }
        }
    }
    .stat {
        display: flex;
        justify-content: space-between;
        margin-bottom: 12px;
        .stat-item {
            flex: 1;
            background-color: #fff;
            box-shadow:0px 2px 4px 0px rgba(0,0,0,0.04);
            border: 1px solid #F0F2F5;
            text-align: center;
            padding: 10px;
            &:nth-of-type(n - 1){
                border-left: none;
            }
            &:last-child{
                border-right: none;
            }
            .title {
                position: relative;
                margin-bottom: 5px;
                &::before {
                    position: absolute;
                    content: '';
                    width: 2px;
                    height: 15px;
                    left: 20px;
                    top: calc(50% - 1px);
                    transform: translate(0, -50%);
                }

                &.blue {
                    &:before {
                        background-color: #007AFF;
                    }
                }

                &.green {
                    &:before {
                        background-color: #00C800;
                    }
                }

                &.orange {
                    &:before {
                        background-color: #F5A623;
                    }
                }

                &.red {
                    &:before {
                        background-color: #FF0019;
                    }
                }
            }
            .num {
                font-size: 12px;
                color: rgba(0, 0, 0, .45);
                &.empty {
                    font-size: 12px;
                    color: rgba(0, 0, 0, .45);
                }
            }
            .el-icon-question{
                color: #ccc;
            }
        }

    }
    /deep/ .el-dialog__header {
        padding-top: 10px;
        box-shadow: 0 1px 0 0 rgba(233,233,233,1);
        display: flex;
        align-items: center;
        background: #FAFAFA;
        border-radius: 4px 4px 0 0;
        .el-dialog__title {
            font-weight: 500;
            color: #333;
            font-size: 14px;
        }
        .el-icon-close:before {
            color: rgb(194,194,194);
            font-size: 17px;
            font-weight: bold;
        }
        .el-dialog__headerbtn {
            top: 14px;
        }
    }
    /deep/ .el-dialog__body {
        padding-bottom: 12px;
    }
    .dialog-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 20px;
    }
    /deep/ .el-textarea__inner {
        resize: none;
    }
    /deep/ .el-table__fixed-right {
        right: 6px!important;
    }
}
</style>
